#ifndef NOTIFY_H
#define NOTIFY_H

#include <string>
#include <vector>
#include <nlohmann/json.hpp> // 需要json库支持
#include "PrintInfo.h"

using json = nlohmann::json;
using namespace std;

enum NotifyType {
    MSG_NOTIFY = 1,
    INVITE_NOTIFY = 2,
    INVITE_RESULT_NOTIFY = 3,
    EXIT_CHAT_NOTIFY = 4,
    DEFAULT=5 
};


// 基类声明
class Notify {

protected:
    // 公有属性
    NotifyType type;
    string chat_room_id;
    string content;
    string time;
    int sender_id;
    int receiver_id;
public:

    virtual ~Notify() = default; // 重要：虚析构函数保证多态正确


    // 序列化接口
    virtual json serialize() const = 0;
    virtual void unserialize(const json& j) = 0;

    virtual NotifyType get_notify_type() const = 0;
    
    int get_sender_id() const {
        return sender_id;
    }
    int get_receiver_id() const {
        return receiver_id;
    }
};








#endif